<div class="form">
      <?php $form=$this->beginWidget('CActiveForm', array(
		'id'=>'exhibition-form','htmlOptions'=>array('role'=>'form','class'=>'form-horizontal tasi-form'),
		// Please note: When you enable ajax validation, make sure the corresponding
		// controller action is handling ajax validation correctly.
		// There is a call to performAjaxValidation() commented in generated controller code.
		// See class documentation of CActiveForm for details on this.
		'enableAjaxValidation'=>false,
	)); ?>

	<p class="note">带 <span class="required">*</span>必填.</p>

	<div class="form-group">
		<?php echo $form->labelEx($model,'activity'); ?>
		<div class="col-sm-10">
		<?php echo $form->textField($model,'activity',array('size'=>60,'maxlength'=>255,'class'=>'form-control')); ?>
		<?php echo $form->error($model,'activity'); ?>
		</div>
	</div>

	<div class="form-group">
		<?php echo $form->labelEx($model,'company'); ?>
		<div class="col-sm-10">
		<div class="input-group m-bot15">
		<?php echo $form->textField($model,'company',array('size'=>60,'maxlength'=>255,'class'=>'form-control')); ?>
		  <div class="input-group-btn">
		      <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">选择 <span class="caret"></span></button>
		      <ul class="dropdown-menu pull-right selectcompany">
		          <?php $exhs = Exhibition::model()->findAll(array(
						    'select'=>array('distinct company'),
						    'order'=>'id ASC',
					));
		          foreach ($exhs as $ex) {
		          	echo "<li><a href='javascript:void(0)'> ".$ex->company."</a></li>";
		          }
				?>
		      </ul>
		  </div>
		</div>
		<?php echo $form->error($model,'company'); ?>
		</div>
	</div>

	<div class="form-group">
		<?php echo $form->labelEx($model,'tel'); ?>
		<div class="col-sm-10">
		<?php echo $form->textField($model,'tel',array('size'=>60,'maxlength'=>100,'class'=>'form-control')); ?>
		<?php echo $form->error($model,'tel'); ?>
		</div>
	</div>

	<div class="form-group">
		<?php echo $form->labelEx($model,'website'); ?>
		<div class="col-sm-10">
		<?php echo $form->textField($model,'website',array('size'=>60,'maxlength'=>255,'class'=>'form-control')); ?>
		<?php echo $form->error($model,'website'); ?>
		</div>
	</div>

	<div class="form-group">
		<?php echo $form->labelEx($model,'place'); ?>
		<div class="col-sm-10">
		<?php echo $form->textField($model,'place',array('size'=>60,'maxlength'=>100,'class'=>'form-control')); ?>
		<?php echo $form->error($model,'place'); ?>
		</div>
	</div>

	<div class="form-group">
		<?php echo $form->labelEx($model,'event'); ?>
		<div class="col-sm-10">
		<?php echo $form->textField($model,'event',array('class'=>'form-control')); ?>
		<?php echo $form->error($model,'event'); ?>
		</div>
	</div>


	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? '提交' : '保存',array('class'=>'btn btn-success')); ?>
		<?php echo CHtml::link('<i class=\'icon-return\'></i> 取消', 'javascript:history.back();', array('class' => 'btn btn-default'));?>	</div>
<?php $this->endWidget(); ?>


<link href="<?php echo Yii::app()->request->baseUrl;?>/js/jqueryui/css/base/jquery-ui.css" rel="stylesheet">
<link href="<?php echo Yii::app()->request->baseUrl;?>/js/jqueryui/css/base/jquery.ui.datepicker.css" rel="stylesheet">
<link href="<?php echo Yii::app()->request->baseUrl;?>/js/jquery-ui-timepicker-addon.css" rel="stylesheet">
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/jqueryui/js/jquery-ui.min.js" type="text/javascript" ></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/jquery-ui-timepicker-addon.js" type="text/javascript" ></script>

<script type="text/javascript">
$(function(){
	$('#Exhibition_event').datetimepicker({
		dateFormat: "yy-mm-dd",
		showSecond: false,
	   	showMillisec: false,
	});
	
	$(".selectcompany li").click(function(){
		var content = $(this).text();
		// alert(content);
		$("#Exhibition_company").val(content);
	});
});

</script>
